//
//  TempletCell.m
//  FruitsWholesaler
//
//  Created by sgone-2 on 15/11/19.
//  Copyright © 2015年 sgone. All rights reserved.
//

#import "TempletCell.h"
//#import "Common.h"
#import "UIImageView+AFNetworking.h"
@implementation TempletCell

- (void)awakeFromNib
{
 

    
    
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

   
}

-(void)loadCell:(NSDictionary *)dic2

{

    
    if ([[dic2 objectForKey:@"image1"] isKindOfClass:[NSNull class]] || [[dic2 objectForKey:@"image1"] length] == 0 ) {
        self.imageTu.image = [UIImage imageNamed:@"backImage"];
    }
    
    
    
    NSURL *url = [ NSURL URLWithString:[dic2 objectForKey:@"image1"]];
    [self.imageTu setImageWithURL:url placeholderImage:[UIImage imageNamed:@"backImage"]];
    
    
    self.labelName.text = [NSString stringWithFormat:@"%@",dic2[@"product_name"]];

    self.labelGuige.text = [NSString stringWithFormat:@"%@",dic2 [@"product_unit"]];

    self.labelPrice.text = [NSString stringWithFormat:@"￥%@",dic2[@"unit_price"]];


}


- (IBAction)btnGou:(id)sender

{
//    UITableViewCell *cell =self;
//    UITableView* tableView = (UITableView*)cell.superview.superview;
//    NSIndexPath *indexPath = [tableView indexPathForCell:cell];
//    NSLog(@"点击勾选状态 :%@",indexPath);
//    
//    
//    [tableView deselectRowAtIndexPath:indexPath animated:NO];
//    
//    
//    [self.delegate  cellSelect:indexPath action:sender];
    
    
    
}
@end
